package com.hqu.environment.controller.app;

import com.hqu.environment.annotation.LoginUser;
import com.hqu.environment.dao.FarmDao;
import com.hqu.environment.dao.NewsDao;
import com.hqu.environment.dto.FarmDTO;
import com.hqu.environment.dto.NewsDTO;
import com.hqu.environment.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description: 消息Controller
 * @Date: 2019/05/18 20:49
 * @Author: 邓勇嘉
 **/
@Controller
@RequestMapping("app/news")
public class NewsController {

    @Autowired
    NewsDao newsDao;

    @RequestMapping("/getNewsListByUserId")
    @ResponseBody
    public Result getNewsListByUserId(@LoginUser Integer userId) {
        List<NewsDTO> newsList = newsDao.getNewsListByUserId(userId);
        return Result.success().add("newsList",newsList);
    }


}
